<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex align-stretch benben-position-layout flex searchResult_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex align-center justify-between flex-sub searchResult_fd0_0'>
          <view class='flex align-center justify-center searchResult_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="back" data-url="1">
            <text class='fu-iconfont2  searchResult_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex align-center flex-sub searchResult_fd0_0_c1'>
            <input class='flex-sub searchResult_fd0_0_c1_c0' type="text" :focus='true' :placeholder="$t('搜索你想要的经文')"
              confirm-type="done" :maxlength="-1" placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
              @confirm="getRequestFunc()" v-model="keyworrld" />
            <image class='searchResult_fd0_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"66.png"' @tap.stop="clearFunc()">
            </image>
          </view>
          <view class='flex flex-wrap align-center justify-center searchResult_fd0_0_c2'>
            <image class='searchResult_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"103.png"'
              @tap.stop="getRequestFunc()"></image>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view>
          <benben-flex-tabs class-name='searchResult_benbenTabsfd1_0' v-model="tabls" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='false' :top='0'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0" @change="getRequestFunc()">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex align-center flex ">
                  <view
                    :class="{ 'checkTitlefd1_0': tabls == '1', 'flex flex-wrap align-center searchResult_titlefd1_0_c3': true }"
                    @tap="tabls = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

                    <text>{{$t('佛经')}}</text>

                  </view>
                  <view
                    :class="{ 'checkTitlefd1_0': tabls == '2', 'flex flex-wrap align-center searchResult_titlefd1_0_c3': true }"
                    @tap="tabls = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

                    <text>{{$t('音频/影音')}}</text>

                  </view>
                  <view
                    :class="{ 'checkTitlefd1_0': tabls == '3', 'flex flex-wrap align-center searchResult_titlefd1_0_c3': true }"
                    @tap="tabls = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

                    <text>{{$t('佛学课程')}}</text>

                  </view>
                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line searchResult_linefd1_0">
                </view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center searchResult_flex_2" v-if=" tabls=='1'">
        <template v-for='(item,key0) in scripturesList'>
          <view class='flex flex-direction flex-wrap align-start searchResult_fd2_0' @tap.stop="handleJumpDiy"
            data-type="navigateTo"
            :data-url="`/pages/fyql/introductionScriptures/introductionScriptures?id=${item.aid}`" :key='key0'>
            <view class='flex flex-wrap align-center'>
              <image class='searchResult_fd2_0_c0_c0' mode="aspectFill" :src='item.img'></image>
            </view>
            <text class='searchResult_fd2_0_c1'>{{item.title}}</text>
            <view class='flex flex-wrap align-center searchResult_fd2_0_c2'>
              <text class='searchResult_fd2_0_c2_c0'>{{item.num}}</text>
              <text class='searchResult_fd2_0_c2_c0'>{{$t('人修持')}}</text>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center searchResult_flex_3" v-if=" tabls=='2'">
        <template v-for='(item,key0) in videList'>
          <view class='flex flex-direction flex-wrap align-start searchResult_fd3_0' :key='key0'
            @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/fyql/audio/audio?id=${item.aid}`">
            <view class='flex flex-wrap align-center searchResult_fd3_0_c0'>
              <image class='searchResult_fd3_0_c0_c0' mode="aspectFill" :src='item.img'></image>
              <view class='flex flex-wrap align-center searchResult_fd3_0_c0_c1'>
                <image class='searchResult_fd3_0_c0_c1_c0' mode="aspectFill" :src='STATIC_URL+"61.png"'></image>
                <text class='searchResult_fd3_0_c0_c1_c1'>{{item.num}}</text>
              </view>
            </view>
            <text class='searchResult_fd3_0_c1'>{{item.title}}</text>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center searchResult_flex_4" v-if=" tabls=='3'">
        <template v-for='(item,key0) in tutorialList'>
          <view class='flex flex-direction flex-wrap align-start searchResult_fd4_0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/fyql/tutorialDetails/tutorialDetails?id=${item.aid}`" :key='key0'>
            <view class='flex flex-wrap align-center searchResult_fd4_0_c0'>
              <image class='searchResult_fd4_0_c0_c0' mode="aspectFill" :src='item.img'></image>
              <view class='flex flex-wrap align-center searchResult_fd4_0_c0_c1'>
                <image class='searchResult_fd4_0_c0_c1_c0' mode="aspectFill" :src='STATIC_URL+"61.png"'></image>
                <text class='searchResult_fd4_0_c0_c1_c1'>{{item.num}}</text>
              </view>
            </view>
            <text class='searchResult_fd4_0_c1'>{{item.title}}</text>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "tabls": "1",
        "scripturesList": [],
        "videList": [],
        "tutorialList": [],
        "keyworrld": ""
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        keyworrld
      } = options
      if (keyworrld !== undefined) this.keyworrld = keyworrld
      this.getRequestFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //清除输入框
      clearFunc() {
        this.keyworrld = ''
      },
      //请求数据
      getRequestFunc() {
        if (this.tabls == '1') {
          this.minixPagingListsApi = global.apiUrls.post657158b834ff4;
          this.pageingListApiMethod = 'post';
          this.allowOnloadGetList = false;
          this.pagingListPostDataContent = {
            keywords: this.keyworrld
          }
          this.listData = [];
          this.scripturesList = this.listData;
          this.pagingListToggle();

        } else if (this.tabls == '2') {
          this.minixPagingListsApi = global.apiUrls.post65715b963ed98;
          this.pageingListApiMethod = 'post';
          this.allowOnloadGetList = false;
          this.pagingListPostDataContent = {
            keywords: this.keyworrld
          }
          this.listData = [];
          this.videList = this.listData;
          this.pagingListToggle();

        } else if (this.tabls == '3') {
          this.minixPagingListsApi = global.apiUrls.post65715ccc124cd;
          this.pageingListApiMethod = 'get';
          this.allowOnloadGetList = false;
          this.pagingListPostDataContent = {
            keywords: this.keyworrld
          }
          this.listData = [];
          this.tutorialList = this.listData;
          this.pagingListToggle();

        }
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(247, 243, 237, 1);
    background-size: 100% auto;
  }

  .searchResult_flex_0 {
    background: rgba(247, 243, 237, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .searchResult_fd0_0_c2_c0 {
    width: 40rpx;
    height: 40rpx;
  }

  .searchResult_fd0_0_c2 {
    margin: 0rpx 0rpx 0rpx 8rpx;
    width: 40rpx;
    height: 40rpx;
  }

  .searchResult_fd0_0_c1_c1 {
    width: 22rpx;
    height: 22rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .searchResult_fd0_0_c1_c0 {
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
  }

  .searchResult_fd0_0_c1 {
    background: rgba(255, 255, 255, 1);
    height: 64rpx;
    border-radius: 34rpx 34rpx 34rpx 34rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
    margin: 0rpx 0rpx 0rpx 24rpx;
  }

  .searchResult_fd0_0_c0_c0 {
    font-size: 32rpx;
    color: #333;
    line-height: 28rpx;
  }

  .searchResult_fd0_0_c0 {
    width: 50rpx;
    height: 50rpx;
  }

  .searchResult_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .searchResult_titlefd1_0_c3 {
    margin: 0rpx 100rpx 0rpx 0rpx;
  }

  .searchResult_linefd1_0 {
    background: rgba(145, 47, 34, 1);
    width: 16rpx;
    height: 16rpx;
    top: 72rpx;
    background-size: 100% auto !important;
    border-radius: 100rpx;
  }

  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 28rpx !important;
    color: #912F22 !important;
  }

  ::v-deep .searchResult_benbenTabsfd1_0 {
    width: 750rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
    padding-left: 46px;
    font-size: 28rpx;
    font-weight: 400;
    color: #666666;
  }

  .searchResult_flex_2 {
    padding: 32rpx 7rpx 0rpx 32rpx;
  }

  .searchResult_fd2_0_c2_c0 {
    color: #999999;
    font-size: 22rpx;
    font-weight: 400;
    line-height: 22rpx;
  }

  .searchResult_fd2_0_c2 {
    margin: 16rpx 0rpx 0rpx 20rpx;
  }

  .searchResult_fd2_0_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 32rpx;
    margin: 20rpx 0rpx 0rpx 20rpx;
  }

  .searchResult_fd2_0_c0_c0 {
    width: 212rpx;
    height: 260rpx;
    border-radius: 40rpx;
  }

  .searchResult_fd2_0 {
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
    border-radius: 40rpx;
    padding: 0rpx 0rpx 20rpx 0rpx;
    width: 212rpx;
    margin: 0rpx 25rpx 20rpx 0rpx;
  }

  .searchResult_flex_3 {
    padding: 32rpx 7rpx 0rpx 32rpx;
  }

  .searchResult_fd3_0_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 32rpx;
    margin: 20rpx 0rpx 0rpx 20rpx;
  }

  .searchResult_fd3_0_c0_c1_c1 {
    color: #FFFFFF;
    font-size: 24rpx;
    font-weight: 700;
    line-height: 35rpx;
  }

  .searchResult_fd3_0_c0_c1_c0 {
    width: 28rpx;
    height: 28rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd3_0_c0_c1 {
    background: rgba(51, 51, 51, 0.8);
    position: absolute;
    padding: 6rpx 12rpx 6rpx 12rpx;
    border-radius: 24rpx;
    background-size: 100% auto;
    bottom: 10rpx;
    right: 10rpx;
  }

  .searchResult_fd3_0_c0_c0 {
    width: 212rpx;
    height: 260rpx;
    border-radius: 40rpx;
  }

  .searchResult_fd3_0_c0 {
    position: relative;
  }

  .searchResult_fd3_0 {
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
    border-radius: 40rpx;
    padding: 0rpx 0rpx 20rpx 0rpx;
    width: 212rpx;
    margin: 0rpx 25rpx 20rpx 0rpx;
  }

  .searchResult_flex_4 {
    padding: 32rpx 7rpx 0rpx 32rpx;
  }

  .searchResult_fd4_0_c1 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 32rpx;
    margin: 20rpx 0rpx 0rpx 20rpx;
  }

  .searchResult_fd4_0_c0_c1_c1 {
    color: #FFFFFF;
    font-size: 24rpx;
    font-weight: 700;
    line-height: 35rpx;
  }

  .searchResult_fd4_0_c0_c1_c0 {
    width: 28rpx;
    height: 28rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .searchResult_fd4_0_c0_c1 {
    background: rgba(51, 51, 51, 0.8);
    position: absolute;
    padding: 6rpx 12rpx 6rpx 12rpx;
    border-radius: 24rpx;
    background-size: 100% auto;
    bottom: 10rpx;
    right: 10rpx;
  }

  .searchResult_fd4_0_c0_c0 {
    width: 212rpx;
    height: 260rpx;
    border-radius: 40rpx;
  }

  .searchResult_fd4_0_c0 {
    position: relative;
  }

  .searchResult_fd4_0 {
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
    border-radius: 40rpx;
    padding: 0rpx 0rpx 20rpx 0rpx;
    width: 212rpx;
    margin: 0rpx 25rpx 20rpx 0rpx;
  }
</style>